home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #5 & #6 / Amiga Plus CD - 1995 - No. 5 and 6.iso / tex / mf / inputs / dc / dxbraces.mf < prev    next >
Text File  |  1994-04-12  |  9KB  |  232 lines

  1. % This is DXBRACES.MF in text format, as of March 24, 1992
  2. %
  3. % DC fonts Version 1.1 (prerelease of EC fonts)
  4. %
  5. %          [ heavily borrowed from the Computer Modern Roman family of
  6. %            fonts by D. E. Knuth ]
  7. %
  8. % Content:
  9. %
  10. % braces and some special characters
  11. %
  12.  
  13. dcchar "Circumflex (hat)";
  14. beginchar(oct"136",11u#,min(asc_height#,2x_height#),0);
  15. if serifs: italcorr .5[x_height#,h#]*slant+.5hair#-1.75u#;
  16.  adjust_fit(0,0);
  17.  pickup crisp.nib; pos2(.5[vair,curve],90); top y2r=.75[x_height,h]; x2=.5w;
  18.  x1=w-x3=good.x 2.25u; y1=y3=.25[x_height,y2];
  19.  pos1(hair,angle(z2-z1)+90); pos3(hair,angle(z3-z2)+90);
  20.  filldraw stroke z1e--z2e--z3e;  % diagonals
  21. else: italcorr 2/3[x_height#,h#]*slant-.5stem#+.5vair#-.75u#;
  22.  adjust_fit(0,0);
  23.  pickup fine.nib; pos1(vair,0); pos3(vair,0); x1=w-x3;
  24.  pos2(stem,0); top y2=2/3[x_height,h]; x2=.5w; bot y1=bot y3=vround x_height-eps;
  25.  lft x1l=hround(rt x2r-3.25u-.5vair); % same slope as in the acute accent
  26.  z0=whatever[z1r,z2r]=whatever[z2l,z3l];
  27.  y4l=y4r=y2; x4l=good.x .2[x2l,x2]; x4r=w-x4l;
  28.  filldraw z4l--z1l--z1r--z0--z3l--z3r--z4r--cycle; fi  % diagonals
  29. penlabels(0,1,2,3,4); endchar;
  30.  
  31.  
  32.  
  33. dcchar "Tilde (squiggle)";
  34. beginchar(oct"176",11u#,min(asc_height#,
  35.                           10/7x_height#+.5dot_size#),0);
  36. italcorr h#*slant-u#;
  37. adjust_fit(0,0);
  38. if serifs: numeric theta; theta=angle(1/6(6u-vair),1/4(h-x_height));
  39.  pickup crisp.nib; numeric mid_width; mid_width=.4[vair,stem];
  40.  pos1(vair,theta+90); pos2(vair,theta+90);
  41.  pos3(vair,theta+90); pos4(vair,theta+90);
  42.  z2-z1=z4-z3=(mid_width-crisp)*dir theta;
  43.  lft x1r=w-rt x4l=hround 1.5u; top y4r=h;
  44.  bot y1l=vround(bot y1l+min(2/3[x_height,h],y3l-.25vair)-top y1r);
  45.  pair delta; ypart delta=3(y3l-y1l); delta=whatever*dir theta;
  46.  filldraw z1l..controls(z1l+delta)and(z3l-delta)..z3l..z4l
  47.   --z4r..controls(z4r-delta)and(z2r+delta)..z2r..z1r--cycle;  % stroke
  48. else: pickup fine.nib; pos1(vair,180); pos2(vair,90);
  49.  pos3(.5[vair,slab],90); pos4(vair,90); pos5(vair,180);
  50.  lft x1r=w-rt x5l=hround 1.5u; x2-x1=x3-x2=x4-x3=x5-x4;
  51.  bot y1=bot y4l=vround(.75[x_height,h]-vair);
  52.  top y2r=top y5=h; y3=.5[y2,y4];
  53.  filldraw stroke z1e{up}...z2e{right}..z3e..{right}z4e...{up}z5e; fi % stroke
  54. penlabels(1,2,3,4,5); endchar;
  55.  
  56.  
  57.  
  58. dcchar "Compound word mark";
  59. beginchar(oct"027",0,0,0);
  60. endchar;
  61.  
  62. dcchar "Left parenthesis";
  63. beginchar("(",7u# if monospace: -u# fi,body_height#,paren_depth#);
  64. italcorr body_height#*slant-.5u#;
  65. adjust_fit(0,0); pickup fine.nib;
  66. pos1(vair,0); pos2(.75[hair,stem],0); pos3(vair,0);
  67. rt x1r=rt x3r=hround(w-u); lft x2l=hround(x1-4u if monospace: +4/3u fi);
  68. top y1=h; y2=.5[y1,y3]=math_axis;
  69. filldraw stroke z1e{3(x2e-x1e),y2-y1}...z2e
  70.  ...{3(x3e-x2e),y3-y2}z3e;  % arc
  71. penlabels(1,2,3); endchar;
  72.  
  73. dcchar "Right parenthesis";
  74. beginchar(")",7u# if monospace: -u# fi,body_height#,paren_depth#);
  75. italcorr math_axis#*slant-.5u#;
  76. adjust_fit(0,0); pickup fine.nib;
  77. pos1(vair,0); pos2(.75[hair,stem],0); pos3(vair,0);
  78. lft x1l=lft x3l=hround u; rt x2r=hround(x1+4u if monospace: -4/3u fi);
  79. top y1=h; y2=.5[y1,y3]=math_axis;
  80. filldraw stroke z1e{3(x2e-x1e),y2-y1}...z2e
  81.  ...{3(x3e-x2e),y3-y2}z3e;  % arc
  82. penlabels(1,2,3); endchar;
  83.  
  84.  
  85. dcchar "Less than sign";
  86. compute_spread(5/4x_height#,3/2x_height#);
  87. beginchar("<",14u#,v_center(spread#+rule_thickness#));
  88. italcorr h#*slant-u#;
  89. adjust_fit(0,0); pickup extra_rule.nib;
  90. lft x2=hround 1.5u-eps; x1=x3=w-x2;
  91. y1-y3=spread; y2=.5[y1,y3]=math_axis;
  92. draw z1--z2--z3;  % diagonals
  93. labels(1,2,3); endchar;
  94.  
  95. dcchar "Vertical line";
  96. beginchar(oct"174",5u#,body_height#,paren_depth#);
  97. italcorr body_height#*slant+.5rule_thickness#-2u#;
  98. adjust_fit(0,0); pickup rule.nib;
  99. x1=x2=good.x .5w; top y1=h+eps; bot y2=-d-eps;
  100. draw z1--z2;  % stem
  101. labels(1,2); endchar;
  102.  
  103.  
  104. dcchar "Greater than sign";
  105. compute_spread(5/4x_height#,3/2x_height#);
  106. beginchar(">",14u#,v_center(spread#+rule_thickness#));
  107. italcorr math_axis#*slant-u#;
  108. adjust_fit(0,0); pickup extra_rule.nib;
  109. rt x2=hround(w-1.5u)+eps; x1=x3=w-x2;
  110. y1-y3=spread; y2=.5[y1,y3]=math_axis;
  111. draw z1--z2--z3;  % diagonals
  112. labels(1,2,3); endchar;
  113.  
  114. dcchar "Left bracket";
  115. numeric wd#; wd#=max(5u#,4.5u#+.5if hefty:stem# else:rule_thickness# fi);
  116. beginchar("[",wd#,body_height#,paren_depth#);
  117. italcorr body_height#*slant;
  118. adjust_fit(0,0);
  119. numeric top_thickness,side_thickness;
  120. % if hefty:
  121.  top_thickness=vair;
  122.  side_thickness=max(crisp.breadth,stem-stem_corr);
  123. % else: top_thickness=side_thickness=rule_thickness; fi;
  124. pickup crisp.nib; pos1(side_thickness,0); pos2(side_thickness,0);
  125. top y1=h; bot y2=-d; lft x1l=lft x2l=hround(2.5u-.5side_thickness)-1-eps;
  126. filldraw stroke z1e--z2e;  % stem
  127. pos3(top_thickness,90); pos4(top_thickness,90);
  128. pos5(top_thickness,90); pos6(top_thickness,90);
  129. x3=x5=x1l; rt x4=rt x6=ceiling(w-.4u)+eps; y3r=y4r=y1; y5l=y6l=y2;
  130. filldraw stroke z3e--z4e;  % upper bar
  131. filldraw stroke z5e--z6e;  % lower bar
  132. penlabels(1,2,3,4,5,6); endchar;
  133.  
  134. dcchar "Right bracket";
  135. numeric wd#; wd#=max(5u#,4.5u#+.5if hefty:stem# else:rule_thickness# fi);
  136. beginchar("]",wd#,body_height#,paren_depth#);
  137. italcorr body_height#*slant-2u#+.5if hefty:stem# else:rule_thickness# fi;
  138. adjust_fit(0,0);
  139. numeric top_thickness,side_thickness;
  140. %if hefty:
  141.   top_thickness=vair;
  142.  side_thickness=max(crisp.breadth,stem-stem_corr);
  143. % else: top_thickness=side_thickness=rule_thickness; fi;
  144. pickup crisp.nib; pos1(side_thickness,0); pos2(side_thickness,0);
  145. top y1=h; bot y2=-d; rt x1r=rt x2r=hround(w-2.5u+.5side_thickness)+1+eps;
  146. filldraw stroke z1e--z2e;  % stem
  147. pos3(top_thickness,90); pos4(top_thickness,90);
  148. pos5(top_thickness,90); pos6(top_thickness,90);
  149. x3=x5=x1r; lft x4=lft x6=floor .4u-eps; y3r=y4r=y1; y5l=y6l=y2;
  150. filldraw stroke z3e--z4e;  % upper bar
  151. filldraw stroke z5e--z6e;  % lower bar
  152. penlabels(1,2,3,4,5,6); endchar;
  153.  
  154.  
  155. dcchar "Reverse slash (backslash)";
  156. beginchar(oct"134",9u#,body_height#,paren_depth#);
  157. adjust_fit(0,0); pickup extra_rule.nib;
  158. lft x1=hround u-eps; top y1=h+eps;
  159. rt x2=hround(w-u)+eps; bot y2=-d-eps;
  160. draw z1--z2;  % diagonal
  161. labels(1,2); endchar;
  162.  
  163. dcchar "Left curly brace";
  164. beginchar(oct"173",9u#,body_height#,paren_depth#);
  165. italcorr body_height#*slant+.5vair#-u#;
  166. adjust_fit(0,0); pickup fine.nib;
  167. forsuffixes $=1,1',4,4',7,7': pos$(vair,0); endfor
  168. forsuffixes $=2,3,5,6: pos$(stem,0); endfor
  169. x2=x3=x5=x6; x1=x1'=x7=x7'=w-x4=w-x4';
  170. lft x4l=hround(1.5u-.5vair); lft x2l=hround(.5w-.5stem);
  171. top y1=h; bot y7=-d; .5[y4,y4']=.5[y1,y7]=.5[y2,y6]=.5[y3,y5];
  172. y1-y2=y3-y4=(y1-y4)/4; y1-y1'=y4-y4'=y7'-y7=vair-fine;
  173. filldraw z1l{left}...z2l---z3l...{left}z4l
  174.  --z4'l{right}...z5l---z6l...{right}z7l
  175.  --z7r--z7'r{left}...z6r---z5r...{left}.5[z4r,z4'r]{right}
  176.  ...z3r---z2r...{right}z1'r--z1r--cycle;  % stroke
  177. penlabels(1,2,3,4,5,6,7); endchar;
  178.  
  179. dcchar "Right curly brace";
  180. beginchar(oct"175",9u#,body_height#,paren_depth#);
  181. italcorr math_axis#*slant+.5vair#-u#;
  182. adjust_fit(0,0); pickup fine.nib;
  183. forsuffixes $=1,1',4,4',7,7': pos$(vair,0); endfor
  184. forsuffixes $=2,3,5,6: pos$(stem,0); endfor
  185. x2=x3=x5=x6; x1=x1'=x7=x7'=w-x4=w-x4';
  186. rt x4r=hround(w-1.5u+.5vair); rt x2r=hround(.5w+.5stem);
  187. top y1=h; bot y7=-d; .5[y4,y4']=.5[y1,y7]=.5[y2,y6]=.5[y3,y5];
  188. y1-y2=y3-y4=(y1-y4)/4; y1-y1'=y4-y4'=y7'-y7=vair-fine;
  189. filldraw z1r{right}...z2r---z3r...{right}z4r
  190.  --z4'r{left}...z5r---z6r...{left}z7r
  191.  --z7l--z7'l{right}...z6l---z5l...{right}.5[z4l,z4'l]{left}
  192.  ...z3l---z2l...{left}z1'l--z1l--cycle;  % stroke
  193. penlabels(1,2,3,4,5,6,7); endchar;
  194.  
  195.  
  196.  
  197.  
  198. dcchar "Underbar";
  199. compute_spread((5/8+.45)*x_height#,(3/4+.55)*x_height#);
  200. beginchar(oct"137",14u#,0,spread#-math_axis#+.5rule_thickness#);
  201. adjust_fit(0,0); pickup rule.nib;
  202. lft x1=hround 1.5u-eps; x2=w-x1; bot y1=bot y2=-d;
  203. draw z1--z2;  % bar
  204. labels(1,2); endchar;
  205.  
  206. dcchar "Hyphen";
  207. beginchar(oct"177",6u#,x_height#,0);
  208. italcorr .5x_height#*slant-.5u#;
  209. adjust_fit(0,0);
  210. numeric thickness; thickness=if hefty:bar else:.75[hair,stem] fi;
  211. pickup crisp.nib; pos1(thickness,90); pos2(thickness,90);
  212. top y1r=top y2r=vround(.5h+.5thickness); rt x2=hround(w-u)+eps;
  213. if monospace: x2=w-x1 else: lft x1=hround .2u-eps fi;
  214. filldraw stroke z1e--z2e;  % bar
  215. penlabels(1,2); endchar;
  216.  
  217. dcchar "Blank-space sign";
  218. beginchar(oct"040",9u#,bar_height#,.5desc_depth#);
  219. italcorr bar_height#*slant-.25u#;
  220. adjust_fit(0,0);
  221. numeric thin_vair#; thin_vair#=.7vair#;
  222. define_whole_blacker_pixels(thin_vair);
  223. forsuffixes $=1,2,3,4: penpos$(thin_vair,0); endfor
  224. penpos0(thin_vair,90); x0=.5w; y0l=vround(-d-.5thin_vair);
  225. x1=x2; x3=x4=w-x1; lft x1l=hround .75u;
  226. y1=y4=h; y2=y3=y0;
  227. fill z1l---z2l...(x2,y0l)---(x3,y0l)...z3r---z4r
  228.  ..z4l---(x3l,y0r)--(x2r,y0r)---z1r..cycle;  % the stroke
  229. penlabels(0,1,2,3,4); endchar;
  230.  
  231. endinput;
  232.